export type ICoinTypes = 'ETH' | 'BTC' | 'CXP' | 'EOS';

export interface CoinInfo {
    address: string,
    amount: string
}

export interface INavigation {
    navigate: (router: string, params?: Object) => void,
    back: Function,
    getParam: (param: string, defaultValue: any) => any
}

export interface IEntrustItem {
    no: number,
    noFilled: number,
    price: number,
    state: number,
    dt: string,
    name: string,
    type: 'buy' | 'sell',
    amount: number | string,
    coinType: string,
    orderId?: string,
    [key: string]: any,
}

export interface IBalanceRecord{
    [key: string]: any,
}

// redux state
export interface IReduxUserInfo {
    readonly name: string,
    readonly sessionid: string,
    readonly userNameChain: string,
}

export interface IReduxBalanceInfo {
    [key: string]: number,
}

/**
 * 显示的行情数据
 */
export interface IReduxMarketItem {
    type: string,
    extent: string,
    value: number,
    lastPrice?: number,
    low: number,
    high: number,
    amount: number, // 成交量
}

export interface IReduxMarketInfo {
    market: Array<IReduxMarketItem>,
    amountToCNY: number,
}

/**
 * topOrder 的数据
 */

export interface IReduxOrderInfo {
    asks: Array<IReduxOrderItemInfo>,
    bids: Array<IReduxOrderItemInfo>,
}

export interface IReduxOrderItemInfo {
    amount: number,
    price: number,
    exchange?: string,
    timestamp?: string,
    user?: string,
    request_id?: string,
}

export interface IReduxLastPrice{
    amount:number,
    price: number,
    timestamp: string,
}


export interface IReduxRecentTransaction {
    timestamp: string | number,
    price: number,
    amount: number,
}

export type IReduxRecentTransactionArray = Array<IReduxRecentTransaction>